/**
 * 
 */
package ${basepackage}.manager.op;

import java.util.List;

import ${basepackage}.manager.exception.ServiceException;
import ${basepackage}.model.criteria.op.RoleCriteria;
import ${basepackage}.model.po.op.Role;
import ${basepackage}.model.vo.common.Page;
import ${basepackage}.model.vo.op.role.AddRoleForm;
import ${basepackage}.model.vo.op.role.RoleRow;
import ${basepackage}.model.vo.op.role.UpdateRoleForm;

/**
 * @author "Jiance Qin"
 * 
 * @date 2014年2月24日
 * 
 * @time 下午5:31:13
 * 
 */
public interface RoleManager {
	/**
	 * 根据ID删除.
	 * 
	 * @param id
	 * @return
	 * @throws ServiceException
	 */
	public boolean delete(Long id) throws ServiceException;

	/**
	 * 根据查询条件分页获取角色的列表.
	 * 
	 * @param criteria
	 * @param offset
	 * @param limit
	 * @return
	 * @throws ServiceException
	 */
	public Page<RoleRow> getRoles(RoleCriteria criteria, int offset,
			int limit) throws ServiceException;

	/**
	 * 获取所有角色及其权限列表.
	 * 
	 * @return
	 * @throws ServiceException
	 */
	public List<Role> getAllRoleAuthoes() throws ServiceException;

	/**
	 * 添加新角色.
	 * 
	 * @param addRoleForm
	 * @return
	 * @throws ServiceException
	 */
	public RoleRow addRole(AddRoleForm addRoleForm) throws ServiceException;

	/**
	 * 更新角色.
	 * 
	 * @param updateRoleForm
	 * @return
	 * @throws ServiceException
	 */
	public RoleRow updateRole(UpdateRoleForm updateRoleForm)
			throws ServiceException;

	/**
	 * 根据角色ID获取角色信息，并获取其相关权限信息.
	 * 
	 * @param roleId
	 * @return
	 * @throws ServiceException
	 */
	public Role getRoleWithAuthoes(Long roleId) throws ServiceException;

	/**
	 * 获取所有角色列表.
	 * 
	 * @return
	 */
	public List<Role> getAllRoles() throws ServiceException;;
}
